<template>
    <div class="app-container">
      <div class="pageContent bgFF">
        <div class="pageContentTop pageFlex pageSpaceBetween">
          <div class="itemBox" :class="{'active': step >= 1}" @click="handleStep(1)">
            选择商品
            <div class="sanBox"></div>
          </div>
          <div class="itemBox" :class="{'active': step >= 2}" @click="handleStep(2)">
            输入库存盘点信息
            <div class="whiteSanBox"></div>
            <div class="sanBox"></div>
          </div>
          <div class="itemBox" :class="{'active': step >= 3}" @click="handleStep(3)">
            库存盘点
            <div class="whiteSanBox"></div>
          </div>
        </div>
        <el-form class="formBox" ref="formRef" :model="form" :rules="rules" label-width="200">
          <div class="normalBox" v-if="step === 1">
            <div class="titleBox pageFlex pageAlignCenter">
              <div class="line"></div>
              <div class="title">请选择商品并填写实盘数量</div>
            </div>
            <div class="contentBox bgFF" style="padding: 20px;">
              <el-row :gutter="10">
                <el-col :span="1.5">
                  <div class="normalBtn pageFlex pageFlexCenter" @click="showTableModal('chooseGood')">
                    <img src="@/assets/images/plus.png" class="normalBtn_icon">
                    <div class="normalBtn_text">添加商品</div>
                  </div>
                </el-col>
                <el-col :span="1.5">
                  <div class="normalBtn pageFlex pageFlexCenter" @click="initData()">
                    <el-icon class="normalBtn_icon2"><Refresh /></el-icon>
                    <div class="normalBtn_text">刷新</div>
                  </div>
                </el-col>
                <el-col :span="1.5">
                  <div class="normalBtn pageFlex pageFlexCenter" :class="{'disabled': !curCheckedList.length}" @click="handleDelete()">
                    <el-icon class="normalBtn_icon2"><Delete /></el-icon>
                    <div class="normalBtn_text">删除所选商品</div>
                  </div>
                </el-col>
              </el-row>
              <el-table
                v-loading="loading"
                :data="dataList"
                border
                style="margin-top: 10px;"
                @selection-change="handleCurChecked">
                <el-table-column type="selection" width="55" align="center" />
                <el-table-column prop="id" label="商品ID" width="100" :show-overflow-tooltip="true" fixed="left"></el-table-column>
                <el-table-column prop="name" label="商品名称" width="180" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="stock" label="库存" width="150" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="costPrice" label="采购成本价" width="150" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="price" label="市场参考价" width="150" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column label="实盘数量" width="160">
                  <template #default="scope">
                    <el-input type="number" v-model="scope.row.actualNumber" style="width: 135px" placeholder="请输入实盘数量" clearable/>
                  </template>
                </el-table-column>
                <el-table-column label="盈亏数量" width="160">
                  <template #default="scope">
                    <el-input type="number" v-model="scope.row.profitLossNumber" style="width: 135px" placeholder="请输入盈亏数量" clearable/>
                  </template>
                </el-table-column>
                <el-table-column label="盈亏金额" width="160">
                  <template #default="scope">
                    <el-input type="number" v-model="scope.row.profitLossAmount" style="width: 135px" placeholder="请输入盈亏金额" clearable>
                      <template #prefix>￥</template>
                    </el-input>
                  </template>
                </el-table-column>
                <el-table-column label="盈亏比例" width="160">
                  <template #default="scope">
                    <el-input type="number" v-model="scope.row.profitLossRatio" style="width: 135px" placeholder="请输入盈亏比例" clearable>
                      <template #suffix>%</template>
                    </el-input>
                  </template>
                </el-table-column>
                <el-table-column label="盈亏类型" width="160">
                  <template #default="scope">
                    <el-select class="inputBox" v-model="scope.row.profitLossType" placeholder="请选择类型" clearable
                      style="width: 135px;">
                      <el-option v-for="dict in profit_loss_type" :key="dict.value" :label="dict.label"
                        :value="dict.value" />
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column label="盈亏方向" width="400">
                  <template #default="scope">
                    <el-input v-model="scope.row.profitLossDirection" style="width: 375px" placeholder="请输入盈亏方向" clearable/>
                  </template>
                </el-table-column>
                <el-table-column label="盈亏描述" width="400">
                  <template #default="scope">
                    <el-input v-model="scope.row.profitLossDesc" style="width: 375px" placeholder="请输入盈亏描述" clearable/>
                  </template>
                </el-table-column>
                <template #empty>
                  <el-empty description="暂未选择商品，请先进行选择"/>
                </template>
              </el-table>
            </div>
            <div class="line"></div>
            <div class="dataManageBottom pageFlex pageFlexCenter">
              <el-button type="primary" @click="handleStep()">下一步</el-button>
            </div>
          </div>
          <div class="normalBox" v-if="step === 2">
            <div class="titleBox pageFlex pageAlignCenter">
              <div class="line"></div>
              <div class="title">库存盘点信息</div>
            </div>
            <div class="contentBox bgFF">
              <el-form-item label="财务" prop="treasurerName">
                <div class="valueBox pageFlex pageAlignCenter" @click="showTableModal('treasurerName')">
                  <el-text class="value">{{ form.treasurerName || '请选择财务' }}</el-text>
                  <el-icon><ArrowRight /></el-icon>
                </div>
              </el-form-item>
              <el-form-item label="库存盘点备注" prop="inventoryResult">
                <el-input
                    class="textareaBox"
                    v-model="form.inventoryResult"
                    type="textarea"
                    :rows="6"
                    placeholder="请输入库存盘点备注"
                />
              </el-form-item>
            </div>
            <div class="line"></div>
            <div class="dataManageBottom pageFlex pageFlexCenter">
              <el-button type="primary" @click="handleStep(1)">上一步</el-button>
              <el-button type="primary" @click="handleStep()">下一步</el-button>
            </div>
          </div>
          <div class="normalBox" v-show="step === 3">
            <div class="titleBox pageFlex pageAlignCenter">
              <div class="line"></div>
              <div class="title">确认信息并开始库存盘点</div>
            </div>
            <div class="contentBox bgFF">
              <el-result
                  icon="success"
                  title="提示"
                  sub-title="请确认前面步骤的内容都填写完毕且信息无误后，点击下方提交按钮即可进行库存盘点"
              >
                <template #extra>
                  <div class="dataManageBottom pageFlex pageFlexCenter">
                    <el-button type="primary" @click="handleStep(2)">上一步</el-button>
                    <el-button type="primary" :loading="submitLoading" @click="submitNow">开始库存盘点</el-button>
                  </div>
                </template>
              </el-result>
            </div>
          </div>
        </el-form>
      </div>
      <el-dialog v-model="chooseGoodShow" title="选择商品" width="1000">
        <div class="tableModalBox">
          <div class="tableModalBox_top pageFlex pageAlignCenter">
            <div class="line"></div>
            <div class="title">请进行选择</div>
          </div>
          <div class="searchBox">
            <el-form :model="chooseGoodParams" ref="chooseGoodTableModal" :inline="true" @submit.prevent>
              <el-form-item prop="name" style="margin: 0 6px 0 0;">
                <el-input
                    class="inputBox"
                    v-model="chooseGoodParams.name"
                    placeholder="请输入商品名查询"
                    clearable
                    @keyup.enter="handleTableModalQuery()"
                />
              </el-form-item>
              <el-form-item style="margin: 0 6px 0 0;">
                <el-button class="normalFormBg searchBtn" icon="Search" @click="handleTableModalQuery()"></el-button>
                <el-button class="normalFormBg searchBtn" icon="Refresh" @click="resetTableModalQuery()"></el-button>
              </el-form-item>
            </el-form>
          </div>
          <div class="tableBox" v-if="chooseGoodShow">
            <el-table
                ref="chooseGoodTableRef"
                v-loading="chooseGoodLoading"
                :data="chooseGoodDataList"
                height="400"
                border
                @selection-change="handleSelectionChange">
              <el-table-column type="selection" width="55" align="center" :selectable="setSelectable" />
              <el-table-column prop="id" label="商品ID" width="100" :show-overflow-tooltip="true" fixed="left"></el-table-column>
              <el-table-column prop="goodsNo" label="商品编码" width="150" :show-overflow-tooltip="true" fixed="left"></el-table-column>
              <el-table-column prop="name" label="商品名称" width="150" :show-overflow-tooltip="true"></el-table-column>
              <el-table-column prop="cover" label="商品图片" width="80" align="center">
                <template #default="scope">
                  <div class="tableImgBox1">
                    <el-image class="img" fit="contain" lazy :src="setCoverUrl(scope.row.cover)" v-if="scope.row.cover" />
                    <div class="emptyBox" v-else>暂无图标</div>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="barCode" label="商品条码" width="150" :show-overflow-tooltip="true"></el-table-column>
              <el-table-column label="市场参考价" width="150" :show-overflow-tooltip="true">
                <template #default="scope">
                  <div style="max-width: 120px;font-weight: 500;" class="textOverflow1">￥{{scope.row.price}}</div>
                </template>
              </el-table-column>
              <el-table-column label="采购成本价" width="150" :show-overflow-tooltip="true">
                <template #default="scope">
                  <div style="max-width: 120px;font-weight: 500;" class="textOverflow1">￥{{scope.row.costPrice}}</div>
                </template>
              </el-table-column>
              <el-table-column prop="stock" label="库存" width="150" :show-overflow-tooltip="true"></el-table-column>
              <template #empty>
                <el-empty description="暂无数据"/>
              </template>
            </el-table>
            <div class="pageFlex pageAlignCenter pageSpaceBetween" style="margin-top: 20px;">
              <div class="totalText">共计 {{chooseGoodTotal}} 条</div>
              <el-pagination background layout="sizes, prev, pager, next" :total="chooseGoodTotal" :current-page="chooseGoodParams.pageNum" :page-size="chooseGoodParams.pageSize"
                 @current-change="handleTablePageChange" @size-change="handleTableSizeChange"/>
            </div>
          </div>
          <div class="lineBox"></div>
          <div class="bottomBox pageFlex pageFlexCenter">
            <el-button @click="clearTableModalChoose">清空当前选择</el-button>
            <el-button type="primary" :disabled="!chooseGoodCheckedList.length" @click="confirmTableModalChoose">确认选择</el-button>
          </div>
        </div>
      </el-dialog>
      <el-dialog v-model="treasurerShow" :title="treasurerTitle" width="728">
        <div class="tableModalBox">
          <div class="tableModalBox_top pageFlex pageAlignCenter">
            <div class="line"></div>
            <div class="title">请进行选择</div>
          </div>
          <div class="searchBox">
            <el-form :model="treasurerParams" ref="treasurerTableModal" :inline="true" @submit.prevent>
              <el-form-item prop="name" style="margin: 0 6px 0 0;">
                <el-input
                    class="inputBox"
                    v-model="treasurerParams.name"
                    placeholder="请输入用户名查询"
                    clearable
                    @keyup.enter="handleTableModalQuery()"
                />
              </el-form-item>
              <el-form-item style="margin: 0 6px 0 0;">
                <el-button class="normalFormBg searchBtn" icon="Search" @click="handleTableModalQuery()"></el-button>
                <el-button class="normalFormBg searchBtn" icon="Refresh" @click="resetTableModalQuery()"></el-button>
              </el-form-item>
            </el-form>
          </div>
          <div class="tableBox">
            <el-table
                ref="treasurerTableRef"
                v-loading="treasurerLoading"
                :data="treasurerDataList"
                border
                height="400"
                @select="handleTableModalSelect"
                @select-all="handleTableModalAll">
              <el-table-column type="selection" width="55" />
              <el-table-column prop="userId" label="用户ID" width="150" :show-overflow-tooltip="true" fixed="left"></el-table-column>
              <el-table-column prop="userName" label="用户名" width="200" :show-overflow-tooltip="true"></el-table-column>
              <el-table-column prop="nickName" label="用户昵称" width="200" :show-overflow-tooltip="true"></el-table-column>
              <el-table-column prop="phonenumber" label="手机号" width="120" :show-overflow-tooltip="true"></el-table-column>
              <template #empty>
                <el-empty description="暂无数据" />
              </template>
            </el-table>
            <div class="pageFlex pageAlignCenter pageSpaceBetween" style="margin-top: 20px;">
              <div class="totalText">共计 {{treasurerTotal}} 条</div>
              <el-pagination background layout="prev, pager, next" :total="treasurerTotal" :current-page="treasurerParams.pageNum" :page-size="treasurerParams.pageSize" @current-change="handleTablePageChange"/>
            </div>
          </div>
          <div class="lineBox"></div>
          <div class="bottomBox pageFlex pageFlexCenter">
            <el-button @click="clearTableModalChoose">清空当前选择</el-button>
            <el-button type="primary" :disabled="!treasurerCur" @click="confirmTableModalChoose">确认选择</el-button>
          </div>
        </div>
      </el-dialog>
    </div>
</template>
<script setup>
import { searchGoodsApi } from '@/api/gasManage/stockManage/goodInfo';
import { batchTakingRecord } from '@/api/gasManage/stockManage/inventoryCountRecord';
import { listUser } from "@/api/system/user";
import {ElMessageBox, ElLoading} from "element-plus";
import {CircleCheck} from "@element-plus/icons-vue";
const { proxy } = getCurrentInstance();
const { profit_loss_type } = proxy.useDict("profit_loss_type");
const curCheckedList = ref([]);
function handleCurChecked(e){
  curCheckedList.value = e;
}
function handleDelete(){
  ElMessageBox.confirm(`确认删除数据?`,'提示', {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: 'warning',
  }).then(() => {
    deleteNow();
  }).catch(() => {})
}
function deleteNow(){
  const loading = ElLoading.service({
    lock: true,
    text: '删除中~',
    background: 'rgba(0, 0, 0, 0.7)',
  })
  if(dataList.value.length === curCheckedList.value.length){
    dataList.value = [];
  }else{
    curCheckedList.value.forEach(item=>{
      let index = dataList.value.findIndex(data=>data.id === item.id);
      dataList.value.splice(index,1);
    })
  }
  toolsDataStore.updateBatchInventoryCount(dataList.value);
  toolsDataStore.updateIsHandleInventoryCount(false);
  loading.close();
}
// -----------------------------------设置步骤---------------------------------
let step = ref(1);
function handleStep(num){
  if(step.value === 1){
    if(dataList.value.length){
      let flag = false;
      for(let i=0;i<dataList.value.length;i++){
        let data = dataList.value[i];
        flag = scanValueError(data);
        if(!flag){
          break;
        }
      }
      if(flag){
        stepChange(num)
      }
    }else{
      proxy.$modal.msgError('您还未选择任何商品！')
    }
  }else{
    if(num < step.value){
      stepChange(num);
    }else{
      proxy.$refs["formRef"].validate(valid => {
        if (valid) {
          stepChange(num);
        }else{
          proxy.$modal.msgError('填写内容有误！请检查');
        }
      })
    }
  }
}
function stepChange(num){
  if(num){
    step.value = num;
  }else{
    step.value++;
  }
}
// -----------------------------------库存盘点---------------------------------
const form = ref({
  inventoryResult: '',
  treasurerId: '',
  treasurerName: ''
});
const rules = ref({
  treasurerName: [{ required: true, message: "请选择财务！", trigger: "blur" }],
});
const submitLoading = ref(false);
function scanValueError(data){
  if(data.actualNumber === ''){
    proxy.$modal.msgError(`【${data.id}】${data.name}的实盘数量不能为空！`)
    return false;
  }
  if(data.profitLossDirection === ''){
    proxy.$modal.msgError(`【${data.id}】${data.name}的盈亏方向不能为空！`)
    return false;
  }
  return true;
}
function submitNow(){
  if(submitLoading.value) return;
  proxy.$refs["formRef"].validate(valid=>{
    if(valid){
      submitLoading.value = true;
      let arr = [];
      dataList.value.forEach(item=>{
        let obj = {
          barCode: item.barCode,
          bookNumber: Number(item.stock),
          costPrice: Number(item.costPrice),
          cover: item.cover,
          goodsId: Number(item.id),
          goodsName: item.name,
          goodsNo: item.goodsNo,
          locationId: Number(item.locationId),
          price: Number(item.price),
          shelfId: item.shelfId,
          spec: item.spec,
          type: item.type,
          unit: item.unit,
          actualNumber: Number(item.actualNumber),
          profitLossNumber: Number(item.profitLossNumber),
          profitLossAmount: Number(item.profitLossAmount),
          profitLossRatio: Number(item.profitLossRatio),
          profitLossType: Number(item.profitLossType),
          profitLossDirection: item.profitLossDirection,
          profitLossDesc: item.profitLossDesc,
        }
        arr.push(Object.assign(obj, form.value))
      })
      batchTakingRecord(arr).then(res => {
        submitLoading.value = false;
        ElMessageBox.confirm(
            '盘点成功',
            '提示',
            {
              type: 'success',
              icon: markRaw(CircleCheck),
              showCancelButton: false
            }
        ).then(()=>{
          toResultPage();
        })
      }).catch(()=>{
        submitLoading.value = false;
      })
    }else{
      proxy.$modal.alertWarning('填写内容有误！请检查');
      submitLoading.value = false;
    }
  })
}
// -----------------------------------表格弹窗通用--------------------------------------
function showTableModal(name){
  chooseGoodShow.value = false;
  treasurerShow.value = false;
  if(name === 'chooseGood'){
    chooseGoodCheckedList.value = [];
    chooseGoodShow.value = true;
  }else if(name === 'treasurerName'){
    treasurerShow.value = true;
    treasurerTitle.value = '选择财务';
  }
  handleTableModalQuery();
}
function handleTableModalQuery(){
  if(treasurerShow.value){
    treasurerParams.value.pageNum = 1;
  }else if(chooseGoodShow.value){
    chooseGoodParams.value.pageNum = 1;
  }
  handleGetTableList();
}
function handleGetTableList(){
  if(treasurerShow.value){
    treasurerLoading.value = true;
    listUser(treasurerParams.value).then(res=>{
      treasurerTotal.value = Number(res.total);
      treasurerDataList.value = Array.isArray(res.rows) ? res.rows : [];
      treasurerLoading.value = false;
      if(form.value.treasurerId && treasurerDataList.value.length){
        let index = treasurerDataList.value.findIndex(item=>item.userId === form.value.treasurerId);
        if(index !== -1){
          nextTick(()=>{
            treasurerCur.value = treasurerDataList.value[index];
            proxy.$refs.treasurerTableRef.toggleRowSelection(treasurerCur.value, true);
          })
        }
      }
    }).catch(()=>{
      treasurerLoading.value = false;
      treasurerDataList.value = [];
    })
  }else if(chooseGoodShow.value){
    chooseGoodLoading.value = true;
    searchGoodsApi(chooseGoodParams.value).then(res=>{
      chooseGoodTotal.value = Number(res.total);
      chooseGoodDataList.value = Array.isArray(res.rows) ? res.rows : [];
      chooseGoodLoading.value = false;
    }).catch(()=>{
      chooseGoodLoading.value = false;
      chooseGoodDataList.value = [];
    })
  }
}
function resetTableModalQuery(){
  if(treasurerShow.value){
    proxy.resetForm("treasurerTableModal");
  }else if(chooseGoodShow.value){
    proxy.resetForm("chooseGoodTableModal");
  }
  handleTableModalQuery();
}
function handleTableModalSelect(e){
  let data = e[0];
  if(treasurerShow.value){
    if(e.length > 1){
      data = e[1]
    }
    if(!data || (treasurerCur.value && treasurerCur.value.userId && treasurerCur.value.userId === data.userId)){
      treasurerCur.value = null;
      return false;
    }
    let index = treasurerDataList.value.findIndex(item=>item.userId === data.userId);
    proxy.$refs.treasurerTableRef.clearSelection();
    treasurerCur.value = data;
    proxy.$refs.treasurerTableRef.toggleRowSelection(treasurerDataList.value[index], true);
  }
}
function handleTableModalAll(){
  if(treasurerShow.value){
    proxy.$refs.treasurerTableRef.clearSelection();
    treasurerCur.value = null;
  }
}
function handleTablePageChange(e){
  if(treasurerShow.value){
    treasurerParams.value.pageNum = e;
  }else if(chooseGoodShow.value){
    chooseGoodParams.value.pageNum = e;
  }
  handleGetTableList();
}
function handleTableSizeChange(e){
  if(chooseGoodShow.value){
    chooseGoodParams.value.pageSize = e;
  }
  handleGetTableList();
}
function clearTableModalChoose(){
  if(treasurerShow.value){
    form.value.treasurerId = '';
    form.value.treasurerMobile = '';
    form.value.treasurerName = '';
    proxy.$refs.treasurerTableRef.clearSelection();
  }else if(chooseGoodShow.value){
    dataList.value = [];
    toolsDataStore.updateBatchInventoryCount([]);
    toolsDataStore.updateIsHandleInventoryCount(false);
    proxy.$refs.chooseGoodTableRef.clearSelection();
  }
  hideTableModal();
}
function confirmTableModalChoose(){
  if(treasurerShow.value){
    form.value.treasurerId = treasurerCur.value.userId;
    form.value.treasurerName = treasurerCur.value.userName;
    hideTableModal();
  }else if(chooseGoodShow.value){
    let arr = JSON.parse(JSON.stringify(chooseGoodCheckedList.value));
    dataList.value = dataList.value.concat(arr);
    toolsDataStore.updateBatchInventoryCount(dataList.value);
    toolsDataStore.updateIsHandleInventoryCount(false);
    hideTableModal();
    initData();
  }
}
function hideTableModal(){
  if(treasurerShow.value){
    treasurerShow.value = false;
    treasurerCur.value = null;
  }else if(chooseGoodShow.value){
    chooseGoodShow.value = false;
  }
}
// -----------------------------------选择商品---------------------------------------
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const setCoverUrl = computed(()=>{
  return url => {
    if(url){
      return baseUrl+url
    }
    return  ''
  }
})
const chooseGoodShow = ref(false);
const chooseGoodLoading = ref(false);
const chooseGoodDataList = ref([]);
const chooseGoodCheckedList = ref([]);
const chooseGoodTotal = ref(0);
const chooseGoodParams = ref({
  pageNum: 1,
  pageSize: 10,
  name: ''
})
function setSelectable(row){
  if(row.isEnable === 0){
    return false
  }else{
    let index = dataList.value.findIndex(item=>item.id === row.id);
    return index === -1;
  }
}
function handleSelectionChange(e){
  chooseGoodCheckedList.value = e;
}
// -----------------------------------选择财务--------------------------------------
const treasurerShow = ref(false);
const treasurerLoading = ref(false);
const treasurerDataList = ref([]);
const treasurerTotal = ref(0);
const treasurerCur = ref(null);
const treasurerTitle = ref('');
const treasurerParams = ref({
  pageNum: 1,
  pageSize: 10,
  userName: ''
});
// ----------------------------------初始化----------------------------------------
import {computed, nextTick, onMounted, watch} from "vue";
import { useRoute } from 'vue-router';
import useTagsViewStore from "@/store/modules/tagsView.js";
import useToolsData from '@/store/modules/tools';
const dataList = ref([]);
const useTagsView = useTagsViewStore();
const toolsDataStore = useToolsData();
const loading = ref(false);
const routes = useRoute();
const watchRoutes = watch(routes, (newVal) => {
  let str = '/gasManage/stockManage/good-info/inventoryCount';
  if(newVal.path === str){
    handleShow();
  }else{
    let index = useTagsView.$state.visitedViews.findIndex(item=>item.path === str);
    if(index === -1){
      toolsDataStore.updateBatchInventoryCount([]);
      toolsDataStore.updateIsHandleInventoryCount(false);
      watchRoutes();
    }
  }
})
onMounted(()=>{
  handleShow();
})
function handleShow(){
  loading.value = true;
  if(toolsDataStore.$state.isHandleInventoryCount){
    dataList.value = toolsDataStore.$state.batchInventoryCount;
  }
  initData()
}
function initData(){
  loading.value = true;
  setTimeout(()=>{
    if(dataList.value.length){
      dataList.value.map(item=>{
        item.actualNumber = 0;
        item.profitLossNumber = 0;
        item.profitLossAmount = 0;
        item.profitLossRatio = 0.00;
        item.profitLossType = '0';
        item.profitLossDirection = '';
        item.profitLossDesc = '';
      })
    }
    loading.value = false;
  }, 500)
}
function toResultPage(){
  const obj = { path: "/gasManage/stockManage/inventoryCountRecord" };
  proxy.$tab.closeOpenPage(obj);
}
</script>
<style lang='scss' scoped>
@import "@/assets/styles/public.scss";
.normalBtn{
  &_icon2{
    margin-right: 10px;
    color: $normalBtnColor;
  }
}
.app-container{
  width: 100%;
  background: $formBgset4;
  min-height: calc(100vh - $navBarHeight);
  .pageContent {
    width: 100%;
    min-width: 1200px;
    min-height: $pageMinHeight;
    border-radius: 6px;
    box-sizing: border-box;
    padding-top: 20px;
    .pageContentTop{
      width: calc(100% - 40px);
      height: 40px;
      margin: 20px auto 0 auto;
      .itemBox{
        width: calc((100% - 10px) / 3);
        height: 100%;
        position: relative;
        background: #F7F8FA;
        margin-right: 2px;
        font-weight: 500;
        font-size: 16px;
        color: #4E5969;
        line-height: 40px;
        box-sizing: border-box;
        padding-left: 60px;
        cursor: pointer;
        .sanBox{
          width: 28px;
          height: 28px;
          background: #F7F8FA;
          transform-origin: center center;
          transform: rotate(45deg);
          position: absolute;
          top: 6px;
          right: -14px;
          z-index: 1;
        }
        .whiteSanBox{
          width: 28px;
          height: 28px;
          background: #FFFFFF;
          transform-origin: center center;
          transform: rotate(45deg);
          position: absolute;
          top: 6px;
          left: -14px;
        }
        &:first-child{
          padding-left: 16px;
        }
        &.active{
          background: var(--el-color-primary);
          color: #FFFFFF;
          .sanBox{
            background: var(--el-color-primary);
          }
        }
      }
    }
    .formBox{
      width: 100%;
      padding: 20px;
      :deep(.el-input){
        .el-input__wrapper{
          background-color: $formBgSet;
          box-shadow: none;
        }
      }
      :deep(.el-textarea){
        .el-textarea__inner{
          background-color: $formBgSet;
          box-shadow: none;
        }
      }
      :deep(.el-select){
        .el-select__wrapper{
          background-color: $formBgSet;
          box-shadow: none;
        }
      }
      .normalBox{
        width: 100%;
        border: 1px solid $borderColor;
        .titleBox{
          width: 100%;
          height: 44px;
          background: $formBgset3;
          padding-left: 8px;
          box-sizing: border-box;
          .line{
            width: 4px;
            height: 16px;
            background: $formBgset2;
            margin-right: 8px;
          }
          .title{
            height: 16px;
            line-height: 16px;
            font-weight: 500;
            font-size: 16px;
            color: #1D2129;
          }
        }
        .contentBox{
          width: 100%;
          padding: 24px 0;
          .inputBox{
            width: 360px;
            height: 32px;
          }
          .textareaBox{
            width: 360px;
          }
          .selectOptionBox{
            width: 360px;
          }
          .valueBox{
            width: 360px;
            height: 32px;
            background-color: $formBgSet;
            padding: 0 10px;
            color: var(--el-text-color-regular);
            cursor: pointer;
            .value{
              flex: 1;
            }
          }
          .imgBox{
            min-width: 360px;
            background: $formBgSet;
            border-radius: 4px;
            padding: 12px;
            .notice{
              height: 20px;
              font-weight: 400;
              font-size: 12px;
              color: #86909C;
              line-height: 20px;
              margin-top: 12px;
            }
          }
        }
        .line{
          width: 100%;
          height: 3px;
          background-color: $formBgset4;
        }
        .dataManageBottom{
          width: 100%;
          height: 72px;
        }
      }
    }
  }
}
</style>